﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace FillCartridgeBBB.Models
{
    public class MovementRepository
    {
        private FillCartridgeDbEntities _db;

        public MovementRepository(FillCartridgeDbEntities db)
        {
            _db = db;
        }

        public IEnumerable<Move> SelectAll()
        {
            return _db.Movement.Include("Department").Include("Printer").Include("CartridgeOld").Include("CartridgeNew");
        }

        public void Insert (Move move)
        {
            _db.AddToMovement(move);
            _db.SaveChanges();
        }
    }
}
